<table border="1" cellpadding="3" cellspacing="0" width="80%">
    <tr align="center">
        <td colspan="9" height="25">Laporan Pembelian Barang</td>
    </tr>
    <tr align="center">
        <td>No Faktur</td>
        <td>Tanggal Faktur</td>
        <td>No PO</td>
        <td>Nama Barang</td>
        <td>Quantity</td>
        <td>Discount</td>
        <td>Amount</td>
        <td>Keterangan</td>
        <td>Nama Pembuat</td>
    </tr>
	<?php 
		foreach($dt_faktur as $items) 
		{
	?>    
            <tr class="cellDefault">
                <td><?php echo $items->NoFaktur ?></td>
                <td><?php echo $items->DateFaktur ?></td>
                <td><?php echo $items->NoPo ?></td>
                <td><?php echo $items->nmbrgdet ?></td>
                <td><?php echo $items->Quantity ?></td>
                <td><?php echo $items->Discount ?></td> 
                <td><?php echo $items->Amount ?></td>
                <td><?php echo $items->Keterangan ?></td> 
                <td><?php echo $items->CreatedBy ?></td> 
            </tr>    
  	<?php } ?>
</table>
<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=exceldata.xls");
header("Pragma: no-cache");
header("Expires: 0");	
?>  